Title: SQL BT (By-BKK) / 12 Exe Order
Tags: Obsidian_to_Anki

Q: What is the first step in SQL query execution?
A: FROM and JOIN clauses are executed to get the working dataset

Q: What does the WHERE clause do in SQL query order?
A: Filters rows in the dataset after FROM and JOIN

Q: What comes after WHERE in SQL query execution order?
A: GROUP BY

Q: What is the role of GROUP BY in SQL?
A: Groups rows by common column values for aggregation

Q: How does HAVING work in query execution sequence?
A: Applies constraints to grouped rows after GROUP BY

Q: When are expressions in SELECT calculated in SQL?
A: After applying HAVING

Q: Where does DISTINCT fit in the order of execution?
A: Removes duplicate rows after SELECT calculations

Q: What does ORDER BY do in query execution?
A: Sorts final rows by chosen column(s)

Q: True or False: LIMIT and OFFSET are the last steps in query execution.
A: True

Q: What happens if an alias is used in WHERE or HAVING?
A: Aliases are usually not accessible in these clauses

Q: Reverse card: Removes duplicate rows after SELECT calculations
A: What does DISTINCT do in the query execution order?

Q: Reverse card: Sorts rows by specified column(s)
A: What does ORDER BY do in SQL queries?

Q: Reverse card: True
A: Are LIMIT and OFFSET executed last in a SQL query?

Q: List the order of clause execution in SQL SELECT.
A: FROM/JOIN, WHERE, GROUP BY, HAVING, SELECT, DISTINCT, ORDER BY, LIMIT/OFFSET

Q: Reverse card: FROM and JOIN clauses #flashcard
Which clauses are executed first in an SQL SELECT query?What is the first step in SQL query execution?
A: FROM and JOIN clauses are executed to get the working dataset

Q: Reverse card: FROM and JOIN clauses
A: Which clauses are executed first in an SQL SELECT query?